import pandas as pd
import os


data_list=[]

p_path = os.getcwd()
dir_path = p_path+"/数据源/TEMU订单/"

for fname in os.listdir(dir_path):
    if fname.endswith(".xlsx"):
        df_excel = pd.read_excel(dir_path + fname)
        store_name = fname.split('-')[0]
        print(f'店铺名称：{store_name}, {len(df_excel)} 条')
        df_excel.insert(0, column='店铺', value=store_name)
        data_list.append(df_excel)

data_all = pd.concat(data_list)
data_all.to_excel(f"{p_path}/处理过的数据/2.订单列表.xlsx", index=False)
print(f'合并 订单 数据完成，数据量：{len(data_all)}条')